#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>
#include<sys/stat.h>
#include<fcntl.h>

 int main(){
     int fd = open("fifo.bt",O_RDWR);
     if(fd<0){
         perror("fifo open error");
         return -1;
     }
     char buf[64];
     memset(buf,0x00,sizeof(buf));
     size_t ret;
	 printf("开始读取\n");
	 while((ret=read(fd,buf,sizeof(buf)))){
		printf("%s ",buf);
	 }
     
     getchar();
     return 0;
 }
